<div style="margin: 5px 0px;">


<?php 
$menuItems[] = array("title" => "STRONA GŁÓWNA", "path" => $APP_PATH."/main");
$menuItems[] = array("title" => "OFERTA", "path" => $APP_PATH."/main/oferta");
$menuItems[] = array("title" => "KONTAKT", "path" => $APP_PATH."/main/contact");


$currentMenuPath = getCurrentMenuPath();
?>

<table class="menuItem" cellpadding="0" cellspacing="0" >
    <tr>
    <?php 
        $index = 0;
        $active = -1;
        foreach ( $menuItems as $key=>$val ) {

            $menuItemActive = "";
            if( $currentMenuPath == $val["path"] ) {
                $menuItemActive = "Active";
                $active = $index;
            }
            
            $menuRightClass = "menuItemRight".$menuItemActive;
            $menuLeftClass = "menuItemLeft".$menuItemActive;
            $menuItemClass = "menuItem".$menuItemActive;

            if( $active == $index-1 ) {
               $menuLeftClass = $menuLeftClass."Next"; 
            }
            
            if( $index == 0 ) {
               $menuLeftClass = "menuItemFirstLeft".$menuItemActive;
            } else if( $index == sizeof($menuItems)-1 ) {
                $menuRightClass = "menuItemLastRight".$menuItemActive;
                $menuItemClass = "menuItemLast".$menuItemActive;
            }
            
    ?>
    <td class="<?php echo $menuLeftClass;?>">&nbsp;</td>
    <td class="<?php echo $menuItemClass;?>"><a href="<?php echo $val["path"];?>"><?php echo $val["title"];?></a></td>
    <td class="<?php echo $menuRightClass;?>">&nbsp;</td>
    <?php 
            $index++;        
        }
    ?>
    </tr>
</table>

</div>


